import {http} from '@/utils/http'
import type {PageParams} from '@/utils/http/types'

export const deleteFirstParties = (ids: number[]) => {
  return http.delete('/contract/firstParty', ids)
}

export const updateFirstParty = (data: FirstParty) => {
  return http.put('/contract/firstParty', data)
}

export const getFirstParty = (id: number) => {
  return http.get<Required<FirstParty>>(`/contract/firstParty/${id}`)
}

export const saveFirstParty = (data: FirstParty) => {
  return http.post('/contract/firstParty', data)
}

export const listFirstParties = (pageParams?: PageParams, firstParty?: Partial<FirstParty>) => {
  return http.listPage<Required<FirstParty>>('/contract/firstParty', pageParams, firstParty)
}
